<script>
			//手动实现assign，instanceof,bind方法,querySelector的方法========================
            var fn_es6fn = {
				assign(){
					if(typeof Object.assign2 != 'function') {
						Object.defineProperty(Object, 'assign2', {
							value: function(target) {
								'use strict';
								if(target == null) {
									throw new TypeError('Cannot convert undefined or null to object');
								}
								var to = Object(target);
								for (var index = 1; index < arguments.length; index++) {
									var nextSource = arguments[index];
									if(nextSource != null) {
										for(var nextKey in nextSource) {
											if(Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
												to[nextKey] = nextSource[nextKey];
											}
										}
									}
								}
								return to;
							},
							writeable: true,
							configuration: true
						});
					}
				},
                myInstanceof(left, right) {
                    //基本数据类型直接返回false
                    if(typeof left !== 'object' || left === null) return false;
                    //getProtypeOf是Object对象自带的一个方法，能够拿到参数的原型对象
                    let proto = Object.getPrototypeOf(left);
                    while(true) {
                        //查找到尽头，还没找到
                        if(proto == null) return false;
                        //找到相同的原型对象
                        if(proto == right.prototype) return true;
                        proto = Object.getPrototypeof(proto);
                    }
                },
                mybind(){
                    Function.prototype.myBind = function(thisArg) {
                    	if (typeof this !== 'function') {
                    		return
                    	}
                    	var _self = this
                    	var args = Array.prototype.slice.call(arguments, 1)
                    	var fnNop = function () {} // 定义一个空函数
                    	var fnBound = function () {
                    		var _this = this instanceof _self ? this : thisArg

                    		return _self.apply(_this, args.concat(Array.prototype.slice.call(arguments)))
                    	}
                    	// 维护原型关系
                    	if (this.prototype) {
                    		fnNop.prototype = this.prototype;
                    	}

                    	fnBound.prototype = new fnNop();

                    	return fnBound;
                    }
                },
                //dom
                querySelector(){
                    if (!document.querySelectorAll) {
                    	document.querySelectorAll = function (selectors) {
                    		var style = document.createElement('style'), elements = [], element;
                    		document.documentElement.firstChild.appendChild(style);
                    		document._qsa = [];

                    		style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
                    		window.scrollBy(0, 0);
                    		style.parentNode.removeChild(style);

                    		while (document._qsa.length) {
                    			element = document._qsa.shift();
                    			element.style.removeAttribute('x-qsa');
                    			elements.push(element);
                    		}
                    		document._qsa = null;
                    		return elements;
                    	};
                    }

                    if (!document.querySelector) {
                    	document.querySelector = function (selectors) {
                    		var elements = document.querySelectorAll(selectors);
                    		return (elements.length) ? elements[0] : null;
                    	};
                    }
                },
                getElementsByClass(className,context){//className:要获取的样式类名，可能是一个或多个；context:获取元素的上下文，即范围，若不传context参数，默认为document
                	var all = document.all ? document.all : document.getElementsByTagName( ' *' ); 
					var elements = new Array();
					for ( var e = 0; e < all.length; e ++ ) { 
						if (all[e].className == className) {
							elements[elements.length] = all[e]; 
						} 
					} 
					return elements; 
                },
				//str fn
				startsWith(){
					String.prototype.startsWith = function (prefix,num){
						if(num) {
							return this.slice(num-1, prefix.length+num-1) === prefix;
						}
						return this.slice(0, prefix.length) === prefix;
					};
				},
				endsWith(){
					String.prototype.endsWith = function(suffix,num) {
						if(num){
							var temp = this.split('').slice(0,this.length - num).join('')
							return temp.indexOf(suffix, temp.length - suffix.length) !== -1;
						}
						return this.indexOf(suffix, this.length - suffix.length) !== -1;
					};
				}
            }
            // 用于在IE6和IE7浏览器中，支持Element.querySelectorAll方法，上面dom的方法调用完之后再调用这里的
            var qsaWorker = (function () {
                var idAllocator = 10000;

                function qsaWorkerShim(element, selector) {
                    var needsID = element.id === "";
                    if (needsID) {
                        ++idAllocator;
                        element.id = "__qsa" + idAllocator;
                    }
                    try {
                        return document.querySelectorAll("#" + element.id + " " + selector);
                    }
                    finally {
                        if (needsID) {
                            element.id = "";
                        }
                    }
                }

                function qsaWorkerWrap(element, selector) {
                    return element.querySelectorAll(selector);
                }

                // Return the one this browser wants to use
                return document.createElement('div').querySelectorAll ? qsaWorkerWrap : qsaWorkerShim;
            })();

</script>